#include <wx/wxprec.h>
#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include "MainFrame.h"
#include <wx/display.h>

class MyApp : public wxApp
{
public:
    virtual bool OnInit();
};

wxIMPLEMENT_APP(MyApp);

bool MyApp::OnInit()
{
    wxDisplay screen;
    wxRect clientRect = screen.GetClientArea();
    int width = (int)(clientRect.GetWidth() * 0.65);
    int height = (int)(width * 0.7);
    wxString title(wxT("欢迎使用图片工具"));
    MainFrame *frame = new MainFrame(title, wxPoint(0, 0), wxSize(width, height), wxDEFAULT_FRAME_STYLE);
    //设置应用图标,需要将icons拷贝到生产的exe同级目录
    wxIcon frameIcon;
    frameIcon.CopyFromBitmap(wxBitmap("./icons/car.bmp", wxBITMAP_TYPE_BMP));
    frame->SetIcon(frameIcon);
    frame->Show(true);
    frame->Centre();
    return true;
}
